package ar.com.angrymachine.hunter.gameplay;

import java.awt.Image;

import ar.com.angrymachine.hunter.HunterResourceManager;

public class Treasure
{
    public int gold = 0;
    public InventoryObject object = null;
    public int openTime;
    public Image icon;
    private String description;

    public Treasure(int gold, InventoryObject newObject, int openTime, String description)
    {
        this.description = description;
        this.gold = gold;
        this.object = newObject;
        this.openTime = openTime;
        // just gold?
        if (newObject == null)
        {
            icon = HunterResourceManager.getImage("gold.png");
            //safeguard
            if(gold == 0)
            {
            	throw new RuntimeException("Gold 0 passed as argument to Treasure");
            }
        }
        else
        {
            icon = newObject.icon;
        }
    }
    
    public String getDescription()
    {
        return description;
    }    
}
